Namespace Tafi.VisionColor.UI

    Partial Class Forms_FrmMainConsultas
        Inherits Tafi.Portal.UI.PortalPage

        Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
            If Not IsPostBack Then
                HdnUrl.Value = Owner.Framework.Configuration.SettingsManager.GetValue("SiteHera") & "Login.aspx?TicketId="
            End If
            NumSolic.Value = Convert.ToDouble("0,4")
        End Sub

        Protected Sub BtnFiltrar_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles BtnFiltrar.Click
            Dim oDS As Data.DataSet
            Dim oTxtRd As IO.StringReader
            Dim Value As String = ""
            Dim oUser As Entities.Us_Web
            Dim oUserDS As DataService.Us_WebDS
            Dim oDetalleSolBC As Tafi.Hermes.Business.SV_DETALLESOLICITUDESBC
            Dim oDT As System.Data.DataTable

            Try
                oUserDS = New DataService.Us_WebDS

            

                oUser = New Entities.Us_Web
                oDetalleSolBC = New Tafi.Hermes.Business.SV_DETALLESOLICITUDESBC
                oUser = Session("oUser")

                oDT = oDetalleSolBC.GetByContrato(oUser.Contrato)

            
                If oDT.Rows.Count > 0 Then                
                    Grid.DataSource = oDT
                Else
                    Grid.DataSource = Nothing
                End If

                Grid.DataBind()            

            Catch ex As Exception
                Throw ex
            Finally
                oUser = Nothing
                oUserDS = Nothing
                oTxtRd = Nothing
                oDS = Nothing
            End Try
        End Sub

        Protected Sub Grid_RowCreated(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles Grid.RowCreated
            Dim oKey As DataKey
            If e.Row.RowType = DataControlRowType.DataRow Then

                oKey = Grid.DataKeys(e.Row.RowIndex)

                e.Row.Cells(1).Text = Format(CDate(oKey("DS_FECHA")), "dd/MM/yyyy HH:mm")

                e.Row.Cells(e.Row.Cells.Count - 1).Text = "<input type=""button"" class=""StandartButton"" value=""Eventos"" onclick=""javascript:Ver(" & oKey("SXT_TICKET").ToString & ");"" />"

                oKey = Nothing
            End If
        End Sub

    End Class

End Namespace
